const app = getApp();
Page({
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    nowCity: "",
    schoolData:[
      {
        name:"高新区启动教学点",
        photo:"https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg",
        addr:"雁塔区"
      },
      {
        name: "南二环第二教学点",
        photo: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg",
        addr: "雁塔区"
      },
      {
        name: "小寨赛格国际教学点",
        photo: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg",
        addr: "雁塔区"
      },
      {
        name: "大雁塔第一教学点",
        photo: "https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg",
        addr: "雁塔区"
      }
    ]
  },
  changCity() {
    wx.navigateTo({
      url: '/pages/component/city/city'
    })
  },
  // 生命周期函数--监听页面初次渲染完成
  onReady: function () {
    var that = this;
  },
  onShow() {
    if (app.globalData.selectedCity.name != undefined) {
      this.setData({
        nowCity: app.globalData.selectedCity.name
      })
    } else {
      this.setData({
        nowCity: "西安"
      })
    }
    // console.log(app.globalData.selectedCity.name)
  },
  clickSchool(e){
    let schoolData = e.currentTarget.dataset.school;
    console.log(schoolData)
    wx.navigateTo({
      url: '/pages/school/details/details'
    })
  }
});
